home *** CD-ROM | disk | FTP | other *** search
- 'WIND Resource Demo
- '©MacTutor™ 1987
- 'By Dave Kelly
-
- Libname$="Hard Disk:Basic:MS ToolLib:ToolLib" ' full Library file name
- LIBRARY Libname$
- WINDResname$="Hard Disk:MacTutor™:May87:Window.rsc" 'full resource name
- WIDTH 40
- DIM a(40)
- FOR i=1 TO 4
- ID%=3040+i
- CALL GetResWindow(WINDResname$,ID%,top,left,bottom,right,ProcID,TitleLength,Title$)
- type=1
- IF ProcID= 0 THEN type=1
- IF ProcID=1 THEN type=2
- IF ProcID=2 THEN type=3
- IF ProcID=3 THEN type=4
- WINDOW i,Title$,(left,top)-(right,bottom),type
- PRINT "Top= ";top,"Left= ";left,"Bottom= ";bottom,"Right= ";right
- PRINT "ProcID = ";ProcID
- PRINT "TitleLength = ";TitleLength
- PRINT "Title = ";Title$
- PRINT "Click mouse to continue"
- WHILE MOUSE(0)<>1:WEND
- NEXT i
- END
-
- SUB GetResWindow (WINDResname$,ID%,top,left,bottom,right,ProcID,TitleLength,Title$) STATIC
- ref%=0
- type$="WIND"
- openresfile WINDResname$,ref%
- loadArray ref%,ID%,a(1),type$
- top=PEEK(VARPTR(a(1)))*256+PEEK(VARPTR(a(1))+1)
- left=PEEK(VARPTR(a(1))+2)*256+PEEK(VARPTR(a(1))+3)
- bottom=PEEK(VARPTR(a(1))+4)*256+PEEK(VARPTR(a(1))+5)
- right=PEEK(VARPTR(a(1))+6)*256+PEEK(VARPTR(a(1))+7)
- ProcID=PEEK(VARPTR(a(1))+8)*256+PEEK(VARPTR(a(1))+9)
- TitleLength=PEEK(VARPTR(a(1))+18)
- closeResFile ref%
- Title$=""
- FOR i=1 TO TitleLength
- Title$=Title$+CHR$(PEEK(VARPTR(a(1))+i+18))
- NEXT
- END SUB
-